package com.wbl.tijiancms.mapper;

import com.wbl.tijiancms.pojo.Orders;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wbl.tijiancms.vo.CalendarResponseDto;
import com.wbl.tijiancms.vo.OrdersMapperDto;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
* @author yy
* @description 针对表【orders】的数据库操作Mapper
* @createDate 2024-09-18 10:09:07
* @Entity com.wbl.tijianssm.pojo.Orders
*/
@Mapper
public interface OrdersMapper extends BaseMapper<Orders> {

//    int deleteByPrimaryKey(Integer orderId);
//
//    int insert(Orders record);
//
//    int insertSelective(Orders record);
//
//    Orders selectByPrimaryKey(Integer orderId);
//
//    int updateByPrimaryKeySelective(Orders record);
//
//    int updateByPrimaryKey(Orders record);
//
//    //根据parameList参数，查询30天预约日期中，每一天的已预约人数
    List<CalendarResponseDto> listOrdersAppointmentNumber(List<OrdersMapperDto> list);

    List<Orders> getOrderForSetmeal(String userid);

    @Insert("insert into orders  values(null,#{orderdate},#{userid},#{hpid},#{smid},#{state});")
    @Options(useGeneratedKeys=true, keyProperty="orderid", keyColumn="orderId")
    Integer insertOrder(Orders orders);


    Orders selectByid(Integer orderid);

    @Update("update orders set state = #{state} where orderId = #{orderId}")
    Integer updateOrderState(@Param("orderId") Integer orderId  ,@Param("state") Integer state);

    List<Orders> getAll(@Param("order") Orders order);


//    List<Orders> getOrderListByUserId (String userId);
}




